//
//  InteractiveSendViewController.m
//  WisdomCommunity
//
//  Created by Yahaong on 16/7/29.
//  Copyright © 2016年 zonten. All rights reserved.
//

#import "InteractiveSendViewController.h"
#import "PhotoSelectorViewController.h"
#import "YHMarcros.h"

@interface InteractiveSendViewController ()
@property (nonatomic, strong)UITextView *textView;
@property (nonatomic, strong)UILabel *placeholderLabel;
@end

@implementation InteractiveSendViewController

- (void)viewDidLoad {
    [super viewDidLoad];


    [self setupUI];
    

 
}
- (void)setupUI
{
    self.view.backgroundColor = kBgColor;
    self.edgesForExtendedLayout = UIRectEdgeNone;
    self.automaticallyAdjustsScrollViewInsets = NO;
    self.navigationItem.title = @"邻里互动";
    [self setupNavigationView];
    [self setupSubView];
}
- (void)setupNavigationView
{
    UIButton *button = [[UIButton alloc]init];
    [button setTitle:@"发送" forState:UIControlStateNormal];
    [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(sendBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [button sizeToFit];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:button];
}

- (void)setupSubView
{
    [self setupInputView];
    [self setupPhotoView];
    
    
}

- (void)setupInputView
{
    [self.view addSubview:self.textView];
    [self.textView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
    }];
    [self.textView addSubview:self.placeholderLabel];
    [self.placeholderLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.textView).offset(8);
        make.leading.equalTo(self.textView).offset(5);
    }];
}
- (void)setupPhotoView
{
    PhotoSelectorViewController *photoSelectorVC = [[PhotoSelectorViewController alloc]init];
    [self.view addSubview:photoSelectorVC.view];
    [photoSelectorVC.view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.leading.trailing.equalTo(self.view);
        make.height.equalTo(300);
    }];
}
- (void)sendBtnClick
{
    
}

#pragma mark <懒加载>


- (UITextView *)textView
{
    if (!_textView) {
        _textView = [[UITextView alloc]init];
        _textView.font = [UIFont systemFontOfSize:20];
        _textView.alwaysBounceVertical = YES;
        _textView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;
    }
    return _textView;
}
- (UILabel *)placeholderLabel
{
    if (!_placeholderLabel) {
        _placeholderLabel = [[UILabel alloc]init];
        _placeholderLabel.text = @"分享新鲜事...";
        _placeholderLabel.font = [UIFont systemFontOfSize:20];
    }
    return _placeholderLabel;
}



@end
